<?php
namespace Service\Service;

/**
 * Base service
 */
abstract class BaseService
{
    /**
     * Service instance
     * @param array
     */
    private static $ins = [];

    /**
     * Get instance
     */
    public static function getIns()
    {
        $ins = null;

        $class = get_called_class();
        if(isset(self::$ins[$class])) {
            $ins = & self::$ins[$class];
        } else {
            self::$ins[$class] = $ins = new $class;
        }

        return $ins; 
    }
}


